//布局配置
const configLayout = {
  view: {
    label: '公共组件', //一级路由的标题
    path: '/view', //一级路由的地址，以'/'开头
    view: 'layouts/LayoutView' //二级路由组件：相对于src目录
  },
  home: {label: '默认页面', path: '/home', view: 'layouts/LayoutHome'},
  menu: {label: '菜单页面', path: '/menu', view: 'layouts/LayoutMenu'},
  tab: {label: '标签页面', path: '/tab', view: 'layouts/LayoutTab'}
};
//路由配置
const configRouter = {};

//公共组件布局的路由配置
configRouter.view = [
  {
    label: '公共组件', //二级路由的标题，同时是一级左侧菜单的标题
    path: 'com', //二级路由的地址，不以'/'开头，同时是一级左侧菜单的Key
    icon: 'wode', //一级左侧菜单的图标类型
    auths: [1, 2], //权限列表：1是管理员，2是开发，3是测试，4是产品。如果未定义auths，则表示不需要校验权限。
    children: [
      {
        label: '表单', //二级路由的标题，同时是二级左侧菜单的标题
        path: 'form', //二级路由的地址，不以'/'开头，同时是二级左侧菜单的Key
        view: 'components/form/Demo', //二级路由组件：相对于src目录
        auths: [1, 2]
      },
      {label: '图标', path: 'icon', view: 'components/icon/Demo', Demo: [1, 2]},
      {label: '图片', path: 'img', view: 'components/img/Demo', Demo: [1, 2]},
      {label: '国际化', path: 'locale', view: 'components/locale/Demo', Demo: [1, 2]},
      {label: '下拉选择', path: 'select', view: 'components/select/Demo', Demo: [1, 2]},
      {label: '上传', path: 'upload', view: 'components/upload/Demo', Demo: [1, 2]}
    ]
  }
];

//默认页面布局的路由配置
configRouter.home = [
  {
    label: '目录',
    path: 'list',
    view: 'pages/Home' //一级路由组件：相对于src目录
  },
  {label: '登录', path: 'login', view: 'pages/login'}
];

//菜单页面布局的路由配置
configRouter.menu = [
  {
    label: '菜单页面',
    path: 'demo',
    icon: 'wodeguanzhu',
    auths: [1, 2, 3, 4],
    children: [
      {label: '订单', path: 'order', view: 'pages/order', auths: [1, 2, 3, 4]},
      {label: '登录', path: 'login', view: 'pages/login'}
    ]
  }
];

//标签页面布局的路由配置
configRouter.tab = [
  {
    label: '标签页面',
    path: 'demo',
    icon: 'wodeguanzhu',
    auths: [1, 2, 3, 4],
    children: [
      {label: '订单', path: 'order', view: 'pages/order', auths: [1, 2, 3, 4]},
      {label: '登录', path: 'login', view: 'pages/login'}
    ]
  }
];

export {configRouter, configLayout};
